package com.jf3q.front.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jf3q.common.domain.EduComment;
import com.jf3q.common.mapper.EduCommentMapper;
import com.jf3q.front.service.CommentService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class CommentServiceImpl extends ServiceImpl<EduCommentMapper, EduComment> implements CommentService {
    @Override
    public Page getPage(String courseId, Integer page, Integer limit) {

        Page<EduComment> pageParam = new Page<>(page, limit);

        LambdaQueryWrapper<EduComment> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(EduComment::getCourseId,courseId);

        return this.page(pageParam,wrapper);
    }
}
